package com.leemz.spring.proxy.dynamic;

import org.aopalliance.intercept.MethodInterceptor;
import org.aopalliance.intercept.MethodInvocation;

/**
 * 拦截器，可以在被代理对象的方法执行前后加入所需要的功能
 * @author leemz
 */
public class Around implements MethodInterceptor {
    @Override
    public Object invoke(MethodInvocation methodInvocation) throws Throwable {
        System.out.println("-----原始方法之前执行-----");
        Object ret = methodInvocation.proceed();
        System.out.println("-----原始方法之后执行-----");
        return ret;
    }
}
